"""
arr = [1,2,3,4,5,6,7,8,9,10]
a = tuple(arr)

max = arr[0]
for i in range (1,10):
    if max < arr[i]:
        max = arr[i]

print(max)
"""
"""
count = 0
for i in range(1,101):
    if i % 10 == 9 or (i // 10) % 10 == 9:
       count += 1
        print(i , end=' ')
print()
print("1-100 一共有 %d 个带 9 的数字"%(count))
"""

"""
count = 0
for i in range(1,101):
    if i % 3 == 0:
        count += 1
        print(i, end=' ')
print()
print("1-100 一共有 %d 个3的倍数"%(count))
"""

"""
a,b,c = input("请输入需要比较的三个数：>").split()
a = int(a)
b = int(b)
c = int(c)

if a < b :
    d = b
    b = a
    a = d
if a < c:
    d = c
    c = a
    a = d
if b < c:
    d = b
    b = c
    c = d

print("%d > %d > %d" %( a, b,c))
"""

ret = 1
sum = 0
num = int(input("请输入num以求阶乘：>"))
for i in range(1,num):
    ret *= i
    sum += ret
print("1 - num 的 阶乘相加是 %d "%(sum))